package com.ruoyi.yijing.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yijing.mapper.YjFamousMapper;
import com.ruoyi.yijing.domain.YjFamous;
import com.ruoyi.yijing.service.IYjFamousService;

/**
 * 易经名家Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-22
 */
@Service
public class YjFamousServiceImpl implements IYjFamousService 
{
    @Autowired
    private YjFamousMapper yjFamousMapper;

    /**
     * 查询易经名家
     * 
     * @param famousId 易经名家主键
     * @return 易经名家
     */
    @Override
    public YjFamous selectYjFamousByFamousId(Long famousId)
    {
        return yjFamousMapper.selectYjFamousByFamousId(famousId);
    }

    /**
     * 查询易经名家列表
     * 
     * @param yjFamous 易经名家
     * @return 易经名家
     */
    @Override
    public List<YjFamous> selectYjFamousList(YjFamous yjFamous)
    {
        return yjFamousMapper.selectYjFamousList(yjFamous);
    }

    /**
     * 新增易经名家
     * 
     * @param yjFamous 易经名家
     * @return 结果
     */
    @Override
    public int insertYjFamous(YjFamous yjFamous)
    {
        yjFamous.setCreateBy(SecurityUtils.getUsername());
        yjFamous.setCreateTime(new Date());
        return yjFamousMapper.insertYjFamous(yjFamous);
    }

    /**
     * 修改易经名家
     * 
     * @param yjFamous 易经名家
     * @return 结果
     */
    @Override
    public int updateYjFamous(YjFamous yjFamous)
    {
        yjFamous.setUpdateBy(SecurityUtils.getUsername());
        yjFamous.setUpdateTime(new Date());
        return yjFamousMapper.updateYjFamous(yjFamous);
    }

    /**
     * 批量删除易经名家
     * 
     * @param famousIds 需要删除的易经名家主键
     * @return 结果
     */
    @Override
    public int deleteYjFamousByFamousIds(Long[] famousIds)
    {
        return yjFamousMapper.deleteYjFamousByFamousIds(famousIds);
    }

    /**
     * 删除易经名家信息
     * 
     * @param famousId 易经名家主键
     * @return 结果
     */
    @Override
    public int deleteYjFamousByFamousId(Long famousId)
    {
        return yjFamousMapper.deleteYjFamousByFamousId(famousId);
    }
}
